home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / sch250.zip / DMMEMO.PRG < prev    next >
Text File  |  1994-12-08  |  2KB  |  54 lines

  1. *****
  2. * A sample programmable text editor.
  3. *****
  4. superbox(00,00,24,79,.t.,"▓",.f.)
  5. superbox(04,09,21,71,.t.,"",.t.)
  6. say(02,25,"    The Sample Text Editor    ")
  7. setcursor(.t.)
  8.  
  9. *****
  10. * This is the new programmable memoedit() routine. You no longer
  11. * need to define a UDF function (Although this is still available as 
  12. * long as it contains no MV variable assignments). Instead, place your
  13. * memoedit() routine into a DO loop and check for specific keys while in the
  14. * loop. Most Control and ALT key combos will exit the memoedit() and allow 
  15. * you to check for the system variable 'termkey'.
  16. *
  17. * Define your new memoedit() function as shown below. Be sure to use the
  18. * 'memallkeys' function as the user defined variable and use the column and
  19. * row cursor position variables as shown (see the memoedit() documentation). 
  20. *
  21. * Use the setmemo() function to set the system variables moldrow,moldcol,
  22. * mcurrow,mcurcol. Once set, they will maintain the cursor positions in your
  23. * memoedit() function even as you enter, exit and re-enter the memoedit()
  24. * function
  25. *****
  26. mvtext="Press any character key to type. Press any Control or Alt key combo to see the programmable keys... "
  27. setmemo(0,0,0,0)
  28. do while .t.
  29.     mvtext=memoedit(mvtext,5,10,20,70,.t.,"memallkeys",60,4,moldrow,moldcol,mcurrow-5,mcurcol-10) 
  30.     if termkey=27
  31.         message("You pressed the ESC key.")
  32.         *****
  33.         * At this point, you could save mvtext as your modified string
  34.         *****
  35.         exit
  36.     else
  37.         message("The key is: "+str(termkey))
  38.     endif
  39. enddo
  40.  
  41. *****
  42. * This is the original memoedit() with the UDF() routine. Note that
  43. * There is no MV variable assignments in the UDF() routine.
  44. *****
  45. mvtext="This is a Memoedit() with a CUSTOM UDF() function"
  46. mv_udfname="dmmemof"
  47. mvtext=memoedit(mvtext,5,10,20,70,.t.,"CUSTOM") 
  48. *****
  49. * At this point, you could save mvtext as your modified string
  50. *****
  51.  
  52. setcursor(.f.)
  53. return
  54.